<?php

/**
 * BaseMovimientodecaja
 * 
 * This class is member of the DAO layer.
 * 
 * @property integer $id
 * @property enum $tipo
 * @property timestamp $fInsert
 * @property integer $idProveedor
 * @property Mproveedor $Mproveedor
 * @property Doctrine_Collection $Movimientocheque
 * @property Doctrine_Collection $Movimientochequecartera
 * @property Doctrine_Collection $Movimientochequepropio
 * @property Doctrine_Collection $Movimientoefectivo
 * @property Doctrine_Collection $Movimientotransferencia
 * 
 * @author     Claudio Corlatti <corlatti@gmail.com>
 *  $Id: BaseMovimientodecaja.php 20 2010-07-16 05:09:08Z corlatti $
 */
abstract class BaseMovimientodecaja extends Doctrine_Record {
    public function setTableDefinition()
    {
        $this->setTableName('movimientodecaja');
        $this->hasColumn('id', 'integer', 4, array('type' => 'integer', 'length' => 4, 'primary' => true, 'autoincrement' => true));
        $this->hasColumn('tipo', 'enum', 13, array('type' => 'enum', 'length' => 13, 'values' => array(0 => 'CHEQUE', 1 => 'EFECTIVO', 2 => 'TRANSFERENCIA'), 'notnull' => true));
        $this->hasColumn('fInsert', 'timestamp', null, array('type' => 'timestamp', 'notnull' => true));
        $this->hasColumn('idProveedor', 'integer', 4, array('type' => 'integer', 'length' => 4));
        $this->hasColumn('idArticulo', 'integer', 4, array('type' => 'integer', 'length' => 4));
        $this->hasColumn('fecha', 'date', null, array('type' => 'timestamp', 'notnull' => true));
    }

    public function setUp()
    {
        $this->hasOne('Mproveedor', array('local' => 'idProveedor',
                                          'foreign' => 'id'));

        $this->hasMany('Movimientocheque', array('local' => 'id',
                                                 'foreign' => 'idMovimientoCaja'));

        $this->hasMany('Movimientochequecartera', array('local' => 'id',
                                                        'foreign' => 'idMovimientoCaja'));

        $this->hasMany('Movimientochequepropio', array('local' => 'id',
                                                       'foreign' => 'idMovimientoCaja'));

        $this->hasMany('Movimientoefectivo', array('local' => 'id',
                                                   'foreign' => 'idMovimientoCaja'));

        $this->hasMany('Movimientotransferencia', array('local' => 'id',
                                                        'foreign' => 'idMovimientoCaja'));
    }
}
?>